Add ability to disable auto trigger deployment on git change#2714
Add ability to disable auto trigger deployment on git change#2714pipecd-bot merged 11 commits intomasterfrom
Conversation
|
Code coverage for golang is
|
|
Code coverage for golang is
|
|
Code coverage for golang is
|
|
Code coverage for golang is
|
| SealedSecrets []SealedSecretMapping `json:"sealedSecrets"` | ||
| // List of directories or files where their changes will trigger the deployment. | ||
| // Regular expression can be used. | ||
| TriggerPaths []string `json:"triggerPaths,omitempty"` |
There was a problem hiding this comment.
We should keep both of fields to avoid breaking changes.
There was a problem hiding this comment.
Ah, I see, then mark it as deprecated and remove it later 👍 Lets me address this
There was a problem hiding this comment.
better update our docs as well
There was a problem hiding this comment.
Sure, will do it by a separated PR 🙏
|
Code coverage for golang is
|
|
This should fix #2245 |
pkg/config/deployment.go
Outdated
| // Regular expression can be used. | ||
| Paths []string `json:"paths,omitempty"` | ||
| // Control trigger new deployment on Git change or not. | ||
| DisableAutoDeployOnChange bool `json:"disableAutoDeployOnChange,omitempty"` |
There was a problem hiding this comment.
How about:
triggerOnChange: true
triggerOnSyncCommand: true
triggerOnChain: trueor
onChange: true
onSyncCommand: true
onChain: trueor
on:
- GIT_CHANGE
- SYNC_COMMAND
- CHAINor
onChange:
disabled: true
onSyncCommand:
disabled: true
onChain:
disabled: true
otherConfig: fooThere was a problem hiding this comment.
I get your point; let me carefully think about this 👍 At a glance, I believe (3) is best for our deployment chain implementation.
There was a problem hiding this comment.
👍 Let take the time to think about that.
There was a problem hiding this comment.
That's too many (but I liked it) 😄
|
/hold |
6591559 to
cbd67d8
Compare
|
Code coverage for golang is
|
|
Code coverage for golang is
|
|
Code coverage for golang is
|
|
/hold cancel |
|
Code coverage for golang is
|
|
Code coverage for golang is
|
pkg/config/deployment.go
Outdated
|
|
||
| type OnCommitConfig struct { | ||
| // Control trigger new deployment on Git change or not. | ||
| Disable bool `json:"disable,omitempty"` |
There was a problem hiding this comment.
"Disabled" because we are using the same format at other places.
There was a problem hiding this comment.
nit: Do we need the Config suffix?
| SealedSecrets []SealedSecretMapping `json:"sealedSecrets"` | ||
| // List of directories or files where their changes will trigger the deployment. | ||
| // Regular expression can be used. | ||
| // Deprecated: use Trigger.Paths instead. |
There was a problem hiding this comment.
The docs in dev should be updated too.
There was a problem hiding this comment.
Will do in a separated PR 🙆♀️
pkg/config/deployment.go
Outdated
|
|
||
| type OnCommitConfig struct { | ||
| // Control trigger new deployment on Git change or not. | ||
| Disable bool `json:"disable,omitempty"` |
There was a problem hiding this comment.
nit: Do we need the Config suffix?
pkg/app/piped/trigger/determiner.go
Outdated
| func (d *Determiner) ShouldTrigger(ctx context.Context, app *model.Application) (bool, error) { | ||
| // Flag `ignoreUserConfig` set to `true` will force check changes and use it to determine | ||
| // the application deployment should be triggered or not, regardless of the user's configuration. | ||
| func (d *Determiner) ShouldTrigger(ctx context.Context, app *model.Application, ignoreUserConfig bool) (bool, error) { |
There was a problem hiding this comment.
How about moving ignoreUserConfig to Determiner while initializing it? In that way, we can keep this function simple as it is.
There was a problem hiding this comment.
Sure, lets me adopt that 🙆♀️
|
Code coverage for golang is
|
|
The following ISSUES will be created once got merged. If you want me to skip creating the issue, you can use Details1. Add logic to determine trigger or not based on other configuration than onCommit.This was created by todo plugin since "TODO:" was found in 8dffc8d when #2714 was merged. cc: @khanhtc1202.2. Remove deprecated
|
|
Code coverage for golang is
|
|
Great! |
|
This small step is the first step of a great walk. Well done 👍 |
What this PR does / why we need it:
Sample configuration for this looks like
Besides, we can also configure watching paths via
spec.trigger.onCommit.Pathsfield, the previousspec.triggerPathsis marked as deprecated and will be removed later.Which issue(s) this PR fixes:
Fixes #2245
Does this PR introduce a user-facing change?: